package com.mapper;

import com.pojo.Department;
import com.pojo.Employee;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {

    /**
     * 根据username查找emp对象
     * @param username
     * @return
     */
    Employee getByUsername(String username);

    /**
     * 根据work_id查找emp对象
     * @param workId
     * @return
     */
    Employee getByWorkId(String workId);

    /**
     * 根据work_id员工id设置annualLeaveTotal总年假天数
     * @param annualLeaveTotal
     */
    void setAnnualLeaveTotal(@Param("workId") String workId, @Param("annualLeaveTotal") int annualLeaveTotal);

    /**
     * 据work_id员工id减少annualLeaveRemain剩余年假天数
     * @param workId
     * @param reduceDay
     */
    void setAnnualLeaveRemain(@Param("workId") String workId, @Param("reduceDay") int reduceDay);

    /**
     * 添加新的员工
     * @param name
     * @param workId
     * @param phoneNumber
     * @param deptId
     */
    void addEmployee(@Param("name") String name, @Param("workId") String workId,
                     @Param("phoneNumber") String phoneNumber, @Param("deptId") int deptId);

    List<Employee> selectAll();
}
